> library(adabag)
> index<-sample(c(1, 2), nrow(iris), replace=T, prob=c(0.7, 0.3))
> train<-iris[index==1, ]
> test<-iris[index==2, ]
> result<-boosting(data=train, Species~., boos=T, mfinal=10)
> plot(result$trees[[10]], margin=0.3)
> text(result$trees[[10]])
> pred<-predict(result, newdata=test)
> pred$confusion
Observed Class
Predicted Class setosa versicolor virginica
setosa 10 0 0
versicolor 0 14 1
virginica 0 0 10